﻿<phone:PhoneApplicationPage
    x:Class="OnlineMovies.Views.OnlineLinks"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
     xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    FontSize="{StaticResource PhoneFontSizeNormal}"
  
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False">
    <phone:PhoneApplicationPage.Resources>
        <ItemsPanelTemplate x:Key="ItemsPanelTemplate1">
            <toolkit:WrapPanel/>
        </ItemsPanelTemplate>
    </phone:PhoneApplicationPage.Resources>
    <!--LayoutRoot is the root grid where all page content is placed-->
    <Grid x:Name="LayoutRoot" Background="{StaticResource bipivot}">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="80"/>
        </Grid.RowDefinitions>

        <!--TitlePanel contains the name of the application and page title-->
        <StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="10,17,0,28" Orientation="Horizontal">
            <Image Style="{StaticResource DetailPagePivotTitleImage}" x:Name="imgTitle"  />
            <TextBlock x:Name="tblkVideosTitle" Text="Online Links"  Style="{StaticResource DetailPagePivotTitle}" />
        </StackPanel>

        <!--ContentPanel - place additional content here-->
      
        <Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0" >
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <toolkit:PerformanceProgressBar  Margin="0,15,0,0" Grid.Row="0"  x:Name="_PerformanceProgressBar"  Foreground="Red"/>
            <Grid x:Name="videogrid" Grid.Row="1">
                <ListBox x:Name="lbxVideo" ItemsPanel="{StaticResource ItemsPanelTemplate1}" Height="500" Margin="0,-40,0,0" SelectionChanged="lbxVideo_SelectionChanged_1" >
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal" Margin="0,-30,0,0" Height="150" >
                                <CheckBox x:Name="chkVideo" Tag="{Binding VideoID}" Background="LightGray" Checked="chkVideo_Checked" Unchecked="chkVideo_Unchecked"></CheckBox>
                                <StackPanel Orientation="Horizontal" x:Name="main">
                                    <Image Source="{Binding ImageUrl}" Stretch="Fill" Height="100" Width="90"></Image>
                                    <StackPanel Orientation="Vertical" Height="90" Margin="10,0,0,0" Background="Chocolate" Width="230">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="Title :" FontSize="20" Foreground="Black"></TextBlock>
                                            <TextBlock Text="{Binding VideoTitle}" Foreground="Black" FontSize="20" Height="30" Width="180" TextTrimming="WordEllipsis"></TextBlock>
                                        </StackPanel>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="Duration :" FontSize="20" Foreground="Black"></TextBlock>
                                            <TextBlock Text="{Binding Duration}" FontSize="20" Foreground="Black"></TextBlock>
                                        </StackPanel>
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="Views :" FontSize="20" Foreground="Black"></TextBlock>
                                            <TextBlock Text="{Binding Views}" FontSize="20" Foreground="Black"></TextBlock>
                                        </StackPanel>
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
                <Canvas>
                    <TextBlock  Foreground="White" Canvas.Left="3" FontSize="28" TextWrapping="Wrap" Width="460" x:Name="tblkFavNoMovies" Text="No Videos available" Visibility="Collapsed"  Margin="80,-200,0,0" Grid.Row="0"/>
                </Canvas>
                <toolkit:PerformanceProgressBar
            VerticalAlignment="Center"
            x:Name="performanceProgressBarVideo"/>
            </Grid>
            <Grid x:Name="audiogrid">
                <ListBox x:Name="lbxAudio" ItemsPanel="{StaticResource ItemsPanelTemplate1}" Height="500">
                        <ListBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="0,-20,0,0" Height="150" >
                                <CheckBox x:Name="chkAudio" Tag="{Binding VideoID}"  Checked="chkAudio_Checked" Unchecked="chkAudio_Unchecked" Background="LightGray"></CheckBox>
                                <TextBlock x:Name="txtAudiotitle" Text="{Binding VideoTitle}" Margin="0,20,0,0" Width="240" FontSize="20" Foreground="White" TextWrapping="Wrap"></TextBlock>
                                </StackPanel>
                            </DataTemplate>
                        </ListBox.ItemTemplate>
                    </ListBox>
                    <Canvas>
                    <TextBlock Canvas.Top="200" Canvas.Left="80" FontSize="28" TextWrapping="Wrap" Width="460" x:Name="tblkAudio" Text="No Audio available" Visibility="Collapsed" Foreground="White"/>
                    </Canvas>
                    <toolkit:PerformanceProgressBar
            VerticalAlignment="Center"
            x:Name="performanceProgressBaraudio"/>
                </Grid>
            </Grid>
        <StackPanel Name="adstackpl" Grid.Row="2" Orientation="Vertical"  Margin="0,3,2,0">
        </StackPanel>
    </Grid>
    <phone:PhoneApplicationPage.ApplicationBar>

        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="False">

            <shell:ApplicationBarIconButton x:Name="btnsave" IconUri="/Images/PlayerImages/save.png" Text="Save" Click="btnsave_Click_1"/>

        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>
</phone:PhoneApplicationPage>